<template>
  <div>
    <!-- 放置一个图标 -->
    <svg-icon
      icon-class="fullscreen"
      style="color:#fff; width: 20px; height: 20px"
      @click="changeScreen"
    />
  </div>
</template>

<script>
import ScreenFull from 'screenfull'
export default {
  methods: {
    // 解决全屏
    changeScreen () {
      // 判断
      if (!ScreenFull.isEnabled) {
        this.$message.success('此时全屏不可用')
        return
      }
      // 此时全屏可用
      ScreenFull.toggle()
    }
  }
}
</script>

<style>
</style>
